package com.rongcheng.fluxtest.actions;

import com.rongcheng.fluxtest.dispatcher.Dispatcher;

/**
 * Created by FengRongCheng on 2016/6/19 16:26.
 * powered by yanxiu.com
 */
public class ActionsCreator {
    private static ActionsCreator instance;
    final Dispatcher dispatcher;

    ActionsCreator(Dispatcher dispatcher) {
        this.dispatcher = dispatcher;
    }
    public static ActionsCreator get(Dispatcher dispatcher) {
        if (instance == null) {
            instance = new ActionsCreator(dispatcher);
        }
        return instance;
    }
    public void sendMessage(String message) {
        dispatcher.dispatch(new LoginAction(LoginAction.ACTION_LOGIN,message));
    }

}
